package com.guigu.video.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.guigu.video.entity.AbCourseVideo;
import com.guigu.video.entity.AbCourseVideo;
import com.guigu.video.service.AbCourseVideoService;
import com.guigu.video.service.AbCourseVideoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

import java.util.List;

/**
 * <p>
 * 课程视频 前端控制器
 * </p>
 *
 * @author liulinjun
 * @since 2020-07-12
 */
@RestController
@RequestMapping("/abCourseVideo")
public class AbCourseVideoController {
    @Autowired
    private com.guigu.video.service.AbCourseVideoService AbCourseVideoService;
    @RequestMapping(value = "/add",method = RequestMethod.POST)
    public boolean add(@RequestBody AbCourseVideo AbCourseVideo){
        return  AbCourseVideoService.save(AbCourseVideo);
    }
    @RequestMapping(value = "/delete",method = RequestMethod.GET)
    public boolean delete(int id){
        return  AbCourseVideoService.removeById(id);
    }
    @RequestMapping(value = "/update",method = RequestMethod.GET)
    public boolean delete(@RequestBody AbCourseVideo AbCourseVideo){
        return  AbCourseVideoService.updateById(AbCourseVideo);

    }
    @RequestMapping(value = "/select",method = RequestMethod.POST)
    public List<AbCourseVideo> add(){
        return  AbCourseVideoService.list();
    }

}

